package org.yellow.backend.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.yellow.backend.pojo.prescription;
import org.yellow.backend.service.prescriptionService;

/**
 * @author: hy
 * @create: 2024-01-01
 */
@RestController
@CrossOrigin
@RequestMapping("/prescription")
public class prescriptionController {
    @Autowired
    private prescriptionService service;
    @GetMapping("/{id}")
    public prescription getPrescription(@PathVariable("id") int id){
        return service.selectPrescriptionById(id);
    }
    @PostMapping("/insert")
    public boolean insertNew(@RequestBody prescription pre){
        return service.insertNew(pre);
    }
}
